package demo12_FunctionInterface;

import java.util.function.Function;
import java.util.function.Predicate;

/**
 * @author kunkun
 * @className Test02_Predicate
 * @Description 断言式函数式接口
 * @date 2025/3/6 21:05
 */
public class Test02_Predicate {

    public static void main(String[] args) {
        Predicate<Integer> predicate = (index)->{return (index>0);};    //断言式接口：一个输出，输出为boolean，用于判断
        System.out.println(predicate.test(100));//true
        System.out.println(predicate.test(-100));//false
    }

}
